#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int arr[10000] = { 0 };
	int n = 0;
	scanf("%d", &n);
	int total = 0;
	for (int i = 0;i < n;i++)
	{
		scanf("%d", &arr[i]);
		total += arr[i];
	}
	int sum = 0;
	for (int j = 0;j < n;j++)
	{
		if (sum * 2 == total - arr[j])
		{
			printf("%d\n", j);
			return 0;
		}
		sum += arr[j];
	}
	printf("-1\n");
	return 0;
}